import React, { FC, useState } from 'react'
import { ImageUploader } from 'antd-mobile'
import { ImageUploadItem } from 'antd-mobile/es/components/image-uploader'

const Basic: FC = () => {
    const [fileList, setFileList] = useState<ImageUploadItem[]>([])
  
    const mockUpload = async(file: File) => {
        await sleep(3000)
        return {
          url: URL.createObjectURL(file),
        }
      }

    return (
      <ImageUploader
        value={fileList}
        onChange={setFileList}
        upload={mockUpload}
      />
    )
  }
function sleep(arg0: number) {
    throw new Error('Function not implemented.')
}

export default Basic